package net.wyy.ssoclient;

import net.wyy.ssocore.ServletUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@SpringBootApplication
@RestController
public class ClientApp {
    public static void main(String[] args) {
        SpringApplication.run(ClientApp.class,args);
    }

    @Value("${server.port}")
    private String port;

    @RequestMapping("/info")
    public String info(HttpServletRequest req){
        ServletUtils.printJsessionId(req,true);

        return "hello, service from client: "+port;
    }
}
